package com.qitmiaojie.mapper;

import com.qitmiaojie.pojo.Menu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Entity com.qitmiaojie.pojo.Menu
 */
@Mapper
@Repository
public interface MenuMapper extends BaseMapper<Menu> {
    /***
    * @description 查询所有菜单
    * @return
    * @author
    * @date
    */
    List<Menu> QueryAllMenu();
    List<String> QueryPermsByMenuId(List<Integer> id);
    @Select("select RoleId from sys_role_menu where MenuId=#{id}")
    List<Integer> QueryRoleIdByMenuId(Integer id);
    List<Menu> QueryMenusByMenuId(List<Integer> id);
    Menu QueryMenuByMenuId(Integer id);
    Integer AddMenu(Menu menu);
    Integer UpdateMenu(Menu menu);
    @Delete("delete from sys_menu where id=#{id}")
    Integer DeleteMenu(Integer id);

}




